package com.codegeek.project.slope.domain;

import com.codegeek.common.utils.ReplaceIllegalChar;
import com.codegeek.framework.aspectj.lang.annotation.Excel;
import com.codegeek.framework.web.domain.BaseEntity;
import lombok.Data;

import java.util.Date;

/**
 * 设备对象 slope_device
 *
 * @author codegeek
 * @date 2020-02-17
 */
@Data
public class SlopeDevice extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    private Long deviceId;

    /**
     * 供应商ID
     */
    @Excel(name = "供应商ID")
    private Long supplierId;

    private SlopeSupplier supplier;

    /**
     * 设备类型
     */
    @Excel(name = "设备类型(对应数据字典)")
    private Integer deviceType;

    /**
     * 设备名称
     */
    @Excel(name = "设备名称")
    private String deviceName;

    /**
     * 设备描述
     */
    @Excel(name = "设备描述")
    private String description;

    /**
     * 设备编号
     */
    @Excel(name = "设备编号")
    private String number;

    /**
     * 0-离线，1-在线，2-维护，3-已更换
     */
    @Excel(name = "设备状态(对应数据字典)")
    private Integer state;

    /**
     * 0-启用，1-停用
     */
    @Excel(name = "是否启用(0-启用，1-停用)")
    private String isValid;

    /**
     * 点位id
     */
    @Excel(name = "点位id")
    private Integer pointId;

    /**
     * 点位
     */
    private SlopePoint point;

    /**
     * 设备接入时间
     */
    @Excel(name = "设备接入时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date joinTime;

    /**
     * 设备最近上线时间
     */
    @Excel(name = "设备最近上线时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date onlineTime;

    /**
     * IMEI号
     */
    @Excel(name = "IMEI号")
    private String imei;

    private String paramValues;

    public void setDeviceName(String deviceName) {
        this.deviceName = new ReplaceIllegalChar().replace(deviceName);
    }

    public void setDescription(String description) {
        this.description = new ReplaceIllegalChar().replace(description);
    }

    public void setNumber(String number) {
        this.number = new ReplaceIllegalChar().replace(number);
    }

    public void setIsValid(String isValid) {
        this.isValid = new ReplaceIllegalChar().replace(isValid);
    }

    public void setImei(String imei) {
        this.imei = new ReplaceIllegalChar().replace(imei);
    }
}
